package com.mos.iot.mqtt.listener.converter.impl;

import com.mos.iot.mqtt.listener.converter.MessageConverter;
import cn.hutool.core.convert.Convert;

public class BaseMessageConverter implements MessageConverter {
    @Override
    public <T> T convert(Object value, Class<T> target, T defaultValue) throws IllegalArgumentException {
        if(value != null) {
            return Convert.convert(target, value);
        }
        return defaultValue;
    }
}
